using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace Mundo_3D
{
    class Camara_Seguimiento : Camara_Basica
    {
        MouseState prevMouseState;
        float speed = 7;
        float currentPitch = 0;
        float totalPitch = MathHelper.PiOver4;
        Manejador_Modelos modelmanager;

        public Camara_Seguimiento(Game game, Vector3 pos, Vector3 target, Vector3 up): base(game)
        {
            cameraPosition = pos;
            cameraDirection = target - pos;
            cameraDirection.Normalize();
            cameraUp = up;
            CreateLookAt();                
        }

        public override void Initialize(){
            //Mouse.SetPosition(Game.Window.ClientBounds.Width / 2, Game.Window.ClientBounds.Height / 2);
            //prevMouseState = Mouse.GetState();
            base.Initialize();
        }
        
        public override void Update(GameTime gameTime, int TipoCam, Vector3 pos){
            Vector3 posaux = new Vector3(pos.X, pos.Y + 10.0f, pos.Z - 25.0f);
            cameraPosition = posaux;        
            CreateLookAt();
            base.Update(gameTime);
        }

        public override void CreateLookAt(){
            view = Matrix.CreateLookAt(cameraPosition, cameraPosition + cameraDirection, cameraUp);
        }
    }
}